
int sum(int n)
{
    if (n == 0)
    {
        return 0;
    }
    else
    {
        return n + sum(n - 1);
    }
    return 0;
}

int main()
{
    int number = 5;
    int result = sum(number);
    return result;
}